package com.magnusart.scrumppm.learning;


import static org.junit.Assert.assertEquals;

import org.junit.Ignore;
import org.junit.Test;

import com.magnusart.scrumify.dao.DBTestUtil;

public class LearnHowToDoFileReads
{

	@Ignore
	@Test
	public void getCurrentDirectory() throws Exception {
		String target_dir = "/home/magnus/Programmering/YAPES/ScrumPPM/test/com/magnusart/scrumppm/learning";
		String current_dir = System.getProperty("user.dir") + "/test/com/magnusart/scrumppm/learning";
		assertEquals("Dirs not equal: '"+ current_dir +"' != '" + target_dir + "'.", target_dir,  current_dir );
	}
	
	@Test
	public void readAFileAndPutItInAString() throws Exception {
		String actual = "This is a test file\n\n\na few lines down.";
		String data = "";
		
		data = DBTestUtil.readFileIntoString( "/test/com/magnusart/scrumppm/learning/readfile.txt"  );
		assertEquals( actual, data );
	}
}

